<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/4/24
 * Time: 10:06
 */

namespace app\controller;

use app\BaseController;

class Demo extends BaseController
{

    public function show()
    {
        //返回json的数据
        $result = [
            'code' => 1,
            'message' => 'success'
        ];
        return json($result);
    }

    /*
     * 绑定request对象
     */
    public function request()
    {
        //第一种获取参数的方式 依赖注入
        dump($this->request->param('id',123,'intval'));

    }


}